<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>请选择数据源</title>
    <link rel="shortcut icon" th:href="@{favicon.ico}">
    <link th:href="@{zui.css}" rel="stylesheet">
</head>
<body>
<table class="table table-hover">
    <thead>
    <tr>
        <th>TYPE</th>
        <th>URL</th>
        <th>选择</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="datasource:${datasources}">
        <td th:text="*{datasource.dbType}"></td>
        <td th:text="*{datasource.url}"></td>
        <td>
            <button type="button" class="btn text-primary ghost" th:id="*{datasource.id}"
                    onclick="javascript:next(this);">选择&nbsp;➜
            </button>
        </td>
    </tr>
    </tbody>
</table>
</body>

<script th:src="@{zui.js}"></script>
<script type="text/javascript">
    function next(elm){
        document.location.href = "/step2?datasourceId=" + elm.id;
    }
</script>

</html>